import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUserGroupController } from '../../../controllers';
const uctoouserGroupRouter = new Router();
const userGroupController = new uctooUserGroupController();

uctoouserGroupRouter.post('/add', requireUser, userGroupController.add);
uctoouserGroupRouter.post('/edit', requireUser, rowLevelPermission('uctoo/user_group'), userGroupController.edit);
uctoouserGroupRouter.post('/del', requireUser, rowLevelPermission('uctoo/user_group'), userGroupController.delete);

//For getting userGroup with permission control
uctoouserGroupRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/user_group'), userGroupController.getSingle);
uctoouserGroupRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/user_group'), userGroupController.getMany);
uctoouserGroupRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/user_group'), userGroupController.getMany);

//#endregion AutoCreateCode
uctoouserGroupRouter.get('/getAll',  userGroupController.getAll);
export default uctoouserGroupRouter;
